using Sirenix.OdinInspector;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;

namespace YouYouMain
{
    public class MainEntry : MonoBehaviour
    {
        //全局参数设置
        [SerializeField]
        private ParamsSettings m_ParamsSettings;
        public static ParamsSettings ParamsSettings { get; private set; }

        //预加载相关事件
        public Action ActionPreloadBegin;
        public Action<float> ActionPreloadUpdate;
        public Action ActionPreloadComplete;

        public static MainEntry Instance { get; private set; }
        private void Awake()
        {
            Instance = this;
            ParamsSettings = m_ParamsSettings;

        }
        private void Start()
        {
            GameObject prefab = Resources.Load<GameObject>("GameEntry");
            Instantiate(prefab);
        }
        private void Update()
        {
		 
		}
        internal static void Log(params object[] args)
        {
#if DEBUG_LOG_NORMAL
            //由于性能原因，如果在Build Settings中没有勾上“Development Build”
            //即使开启了DEBUG_LOG_NORMAL也依然不打印普通日志， 只打印警告日志和错误日志
            if (!Debug.isDebugBuild)
            {
                return;
            }
            Debug.Log("MainEntryLog - " + args.Aggregate("", (current, message) => current + (" - " + message)));
#endif
        }

        internal static void LogWarning(params object[] args)
        {
#if DEBUG_LOG_WARNING
            Debug.LogWarning("MainEntryLog - " + args.Aggregate("", (current, message) => current + (" - " + message)));
#endif
        }

        internal static void LogError(params object[] args)
        {
#if DEBUG_LOG_ERROR
            Debug.LogError("MainEntryLog - " + args.Aggregate("", (current, message) => current + (" - " + message)));
#endif
        }

    }
}